.class public Lcom/xiaomi/notes/ShareData;
.super Ljava/lang/Object;
.source "ShareData.java"


# static fields
.field private static final STR_XML_FOLDER_NODE:Ljava/lang/String; = "FOLDER"

.field private static final STR_XML_NOTE_NODE:Ljava/lang/String; = "NOTE"

.field private static final STR_XML_ROOT:Ljava/lang/String; = "XM_NOTES"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 20
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V
    .locals 2
    .parameter "op"
    .parameter "key"
    .parameter "value"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 164
    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 165
    invoke-interface {p0, v1, p1}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 166
    invoke-interface {p0, p2}, Lorg/xmlpull/v1/XmlSerializer;->text(Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 167
    invoke-interface {p0, v1, p1}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 169
    :cond_0
    return-void
.end method

.method private static backupTxt(Landroid/content/Context;Lcom/xiaomi/notes/DBOperate;Ljava/io/FileOutputStream;)V
    .locals 13
    .parameter "context"
    .parameter "db"
    .parameter "fosContent"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 389
    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Lcom/xiaomi/notes/DBOperate;->getFolder(I)Ljava/util/List;

    move-result-object v3

    .line 390
    .local v3, listFolder:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Lcom/xiaomi/notes/DBOperate;->getNotes(I)Ljava/util/List;

    move-result-object v2

    .line 391
    .local v2, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f05003f

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v6

    .line 392
    .local v6, split:Ljava/lang/String;
    const/4 v0, 0x0

    .line 393
    .local v0, numsFolder:I
    const/4 v1, 0x0

    .line 394
    .local v1, numsNotes:I
    if-eqz v3, :cond_2

    .line 395
    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v0

    move v5, v0

    .line 397
    .end local v0           #numsFolder:I
    .local v5, numsFolder:I
    :goto_0
    if-eqz v2, :cond_1

    .line 398
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v0

    .line 400
    .end local v1           #numsNotes:I
    .local v0, numsNotes:I
    :goto_1
    const/4 v1, 0x0

    .line 404
    .local v1, infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v7, 0x7f05003d

    const/4 v8, 0x3

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v10

    invoke-static {p0, v10, v11}, Lcom/xiaomi/notes/Tools;->getTimeMDHM(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v10

    aput-object v10, v8, v9

    const/4 v9, 0x1

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    aput-object v10, v8, v9

    const/4 v9, 0x2

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    .end local v0           #numsNotes:I
    aput-object v0, v8, v9

    invoke-virtual {v4, v7, v8}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    const/4 v4, 0x1

    invoke-static {p2, v0, v4}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 409
    const/4 v0, 0x0

    const/4 v4, 0x1

    invoke-static {p2, v0, v4}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 411
    const/4 v0, 0x0

    const/4 v4, 0x1

    invoke-static {p2, v0, v4}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 413
    const/4 v0, 0x0

    .local v0, i:I
    :goto_2
    if-ge v0, v5, :cond_0

    .line 414
    invoke-interface {v3, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    .end local v2           #list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    check-cast v2, Ljava/util/Map;

    .line 415
    .end local v1           #infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v2, infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v1, "_id"

    invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 416
    .local v1, id:I
    const-string v4, "foldername"

    invoke-interface {v2, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    .line 417
    .local v4, name:Ljava/lang/String;
    invoke-virtual {p1, v1}, Lcom/xiaomi/notes/DBOperate;->getNotes(I)Ljava/util/List;

    move-result-object v1

    .line 419
    .local v1, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v7, 0x1

    invoke-static {p2, v6, v7}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 421
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f05003e

    const/4 v9, 0x1

    new-array v9, v9, [Ljava/lang/Object;

    const/4 v10, 0x0

    aput-object v4, v9, v10

    invoke-virtual {v7, v8, v9}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .end local v4           #name:Ljava/lang/String;
    const/4 v7, 0x1

    invoke-static {p2, v4, v7}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 424
    const/4 v4, 0x1

    invoke-static {p2, v6, v4}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 426
    invoke-static {p0, v1, p2}, Lcom/xiaomi/notes/ShareData;->backupTxt(Landroid/content/Context;Ljava/util/List;Ljava/io/FileOutputStream;)V

    .line 428
    const/4 v4, 0x0

    const/4 v7, 0x1

    invoke-static {p2, v4, v7}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 413
    add-int/lit8 v0, v0, 0x1

    move-object v12, v2

    .end local v2           #infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v12, infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    move-object v2, v1

    .end local v1           #list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .local v2, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    move-object v1, v12

    .end local v12           #infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v1, infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    goto :goto_2

    .line 431
    :cond_0
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    .end local v0           #i:I
    const/high16 v1, 0x7f05

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    .end local v1           #infoFolder:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    move-result-object v0

    .line 432
    .local v0, name:Ljava/lang/String;
    const/4 v1, -0x1

    invoke-virtual {p1, v1}, Lcom/xiaomi/notes/DBOperate;->getNotes(I)Ljava/util/List;

    move-result-object p1

    .line 433
    .end local v2           #list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .local p1, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v1, 0x1

    invoke-static {p2, v6, v1}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 434
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f05003e

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    .end local v3           #listFolder:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v4, 0x0

    aput-object v0, v3, v4

    invoke-virtual {v1, v2, v3}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .end local v0           #name:Ljava/lang/String;
    const/4 v1, 0x1

    invoke-static {p2, v0, v1}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 436
    const/4 v0, 0x1

    invoke-static {p2, v6, v0}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 437
    invoke-static {p0, p1, p2}, Lcom/xiaomi/notes/ShareData;->backupTxt(Landroid/content/Context;Ljava/util/List;Ljava/io/FileOutputStream;)V

    .line 438
    return-void

    .local v1, numsNotes:I
    .restart local v2       #list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .restart local v3       #listFolder:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .local p1, db:Lcom/xiaomi/notes/DBOperate;
    :cond_1
    move v0, v1

    .end local v1           #numsNotes:I
    .local v0, numsNotes:I
    goto/16 :goto_1

    .end local v5           #numsFolder:I
    .local v0, numsFolder:I
    .restart local v1       #numsNotes:I
    :cond_2
    move v5, v0

    .end local v0           #numsFolder:I
    .restart local v5       #numsFolder:I
    goto/16 :goto_0
.end method

.method private static backupTxt(Landroid/content/Context;Ljava/util/List;Ljava/io/FileOutputStream;)V
    .locals 10
    .parameter "context"
    .parameter
    .parameter "fosContent"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;",
            "Ljava/io/FileOutputStream;",
            ")V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .local p1, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v9, 0x0

    const/4 v8, 0x1

    .line 442
    const/4 v5, 0x0

    .line 443
    .local v5, nums:I
    if-nez p1, :cond_1

    .line 465
    :cond_0
    return-void

    .line 446
    :cond_1
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v5

    .line 447
    const/4 v4, 0x0

    .line 452
    .local v4, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-ge v3, v5, :cond_0

    .line 453
    invoke-interface {p1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    .end local v4           #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v4, Ljava/util/Map;

    .line 454
    .restart local v4       #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v7, "fixTime"

    invoke-interface {v4, v7}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/Long;

    invoke-virtual {v7}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    .line 455
    .local v1, fix:J
    invoke-static {p0, v1, v2}, Lcom/xiaomi/notes/Tools;->getTimeMDHM(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v6

    .line 456
    .local v6, time:Ljava/lang/String;
    const-string v7, "content"

    invoke-interface {v4, v7}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 459
    .local v0, content:Ljava/lang/String;
    invoke-static {p2, v6, v8}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 461
    invoke-static {p2, v0, v8}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 462
    invoke-static {p2, v9, v8}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 463
    invoke-static {p2, v9, v8}, Lcom/xiaomi/notes/ShareData;->writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V

    .line 452
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method private static backupXml(Lcom/xiaomi/notes/DBOperate;Ljava/io/FileOutputStream;)V
    .locals 7
    .parameter "db"
    .parameter "fos"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x0

    const-string v6, "XM_NOTES"

    const-string v5, "UTF-8"

    .line 81
    invoke-static {}, Landroid/util/Xml;->newSerializer()Lorg/xmlpull/v1/XmlSerializer;

    move-result-object v1

    .line 84
    .local v1, op:Lorg/xmlpull/v1/XmlSerializer;
    const-string v2, "UTF-8"

    invoke-interface {v1, p1, v5}, Lorg/xmlpull/v1/XmlSerializer;->setOutput(Ljava/io/OutputStream;Ljava/lang/String;)V

    .line 85
    const-string v2, "UTF-8"

    const/4 v2, 0x1

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    invoke-interface {v1, v5, v2}, Lorg/xmlpull/v1/XmlSerializer;->startDocument(Ljava/lang/String;Ljava/lang/Boolean;)V

    .line 86
    const-string v2, "XM_NOTES"

    invoke-interface {v1, v4, v6}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 88
    invoke-virtual {p0, v3}, Lcom/xiaomi/notes/DBOperate;->getFolder(I)Ljava/util/List;

    move-result-object v0

    .line 89
    .local v0, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    if-eqz v0, :cond_0

    .line 90
    invoke-static {v1, v0}, Lcom/xiaomi/notes/ShareData;->operateFolder(Lorg/xmlpull/v1/XmlSerializer;Ljava/util/List;)V

    .line 92
    :cond_0
    invoke-virtual {p0, v3}, Lcom/xiaomi/notes/DBOperate;->getNotes(I)Ljava/util/List;

    move-result-object v0

    .line 93
    if-eqz v0, :cond_1

    .line 94
    invoke-static {v1, v0}, Lcom/xiaomi/notes/ShareData;->operateNote(Lorg/xmlpull/v1/XmlSerializer;Ljava/util/List;)V

    .line 97
    :cond_1
    const-string v2, "XM_NOTES"

    invoke-interface {v1, v4, v6}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 98
    invoke-interface {v1}, Lorg/xmlpull/v1/XmlSerializer;->endDocument()V

    .line 99
    invoke-interface {v1}, Lorg/xmlpull/v1/XmlSerializer;->flush()V

    .line 100
    return-void
.end method

.method public static callBackupXml(Landroid/content/Context;Lcom/xiaomi/notes/DBOperate;Z)Ljava/lang/String;
    .locals 7
    .parameter "context"
    .parameter "db"
    .parameter "isEnd"

    .prologue
    .line 32
    const/4 v3, 0x0

    .line 35
    .local v3, ret:Ljava/lang/String;
    const-string v0, "mounted"

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 36
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1
    const p2, 0x7f050038

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    .end local p2
    move-result-object p2

    .line 37
    .local p2, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v0, 0x7f05002c

    invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object p1

    .line 38
    .local p1, message:Ljava/lang/String;
    invoke-static {p0, p2, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    move-object p0, p1

    .end local p1           #message:Ljava/lang/String;
    .local p0, message:Ljava/lang/String;
    move-object v0, p2

    .end local p2           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    move-object p1, v3

    .end local v3           #ret:Ljava/lang/String;
    .local p1, ret:Ljava/lang/String;
    move-object p2, v3

    .line 77
    .end local p1           #ret:Ljava/lang/String;
    :goto_0
    return-object p2

    .line 41
    .end local v0           #title:Ljava/lang/String;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :cond_0
    const/4 v2, 0x0

    .line 42
    .local v2, fos:Ljava/io/FileOutputStream;
    new-instance v0, Ljava/io/File;

    sget-object v1, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 43
    .local v0, dic:Ljava/io/File;
    new-instance v1, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v5, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "notes.xml"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 45
    .local v1, fileText:Ljava/io/File;
    :try_start_0
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v4

    if-nez v4, :cond_1

    .line 46
    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    .line 48
    :cond_1
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v0

    .end local v0           #dic:Ljava/io/File;
    if-nez v0, :cond_2

    .line 49
    invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z

    .line 52
    :cond_2
    new-instance v0, Ljava/io/FileOutputStream;

    invoke-direct {v0, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4

    .line 53
    .end local v2           #fos:Ljava/io/FileOutputStream;
    .local v0, fos:Ljava/io/FileOutputStream;
    :try_start_1
    invoke-static {p1, v0}, Lcom/xiaomi/notes/ShareData;->backupXml(Lcom/xiaomi/notes/DBOperate;Ljava/io/FileOutputStream;)V

    .line 55
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #db:Lcom/xiaomi/notes/DBOperate;
    const v1, 0x7f050034

    invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    .end local v1           #fileText:Ljava/io/File;
    move-result-object v1

    .line 56
    .local v1, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v2, 0x7f050031

    const/4 v4, 0x2

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    const-string v6, "notes.xml"

    aput-object v6, v4, v5

    const/4 v5, 0x1

    const-string v6, "xm_notes"

    aput-object v6, v4, v5

    invoke-virtual {p1, v2, v4}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    .line 58
    .local p1, message:Ljava/lang/String;
    if-eqz p2, :cond_3

    .line 59
    invoke-static {p0, v1, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    .end local p2           #isEnd:Z
    :goto_1
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v2, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p2

    const-string v2, "notes.xml"

    invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p2

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result-object p2

    .line 70
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    if-eqz v0, :cond_6

    .line 71
    :try_start_2
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 72
    const/4 p0, 0x0

    .end local v0           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    :goto_2
    move-object v0, v1

    .end local v1           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    :goto_3
    move-object p0, p1

    .end local p1           #message:Ljava/lang/String;
    .local p0, message:Ljava/lang/String;
    move-object p1, p2

    .line 77
    .end local p2           #ret:Ljava/lang/String;
    .local p1, ret:Ljava/lang/String;
    goto/16 :goto_0

    .line 61
    .local v0, fos:Ljava/io/FileOutputStream;
    .restart local v1       #title:Ljava/lang/String;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, message:Ljava/lang/String;
    .local p2, isEnd:Z
    :cond_3
    const/4 p2, 0x1

    :try_start_3
    invoke-static {p0, p1, p2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    .end local p2           #isEnd:Z
    move-result-object p2

    invoke-virtual {p2}, Landroid/widget/Toast;->show()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0

    goto :goto_1

    .line 64
    .end local v1           #title:Ljava/lang/String;
    .end local p1           #message:Ljava/lang/String;
    :catch_0
    move-exception p1

    move-object p2, v0

    .line 65
    .end local v0           #fos:Ljava/io/FileOutputStream;
    .local p1, e:Ljava/lang/Exception;
    .local p2, fos:Ljava/io/FileOutputStream;
    :goto_4
    :try_start_4
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #e:Ljava/lang/Exception;
    const v0, 0x7f050037

    invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 66
    .local v0, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v1, 0x7f05002e

    invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object p1

    .line 67
    .local p1, message:Ljava/lang/String;
    invoke-static {p0, v0, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_2

    .line 70
    if-eqz p2, :cond_5

    .line 71
    :try_start_5
    invoke-virtual {p2}, Ljava/io/FileOutputStream;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2

    .line 72
    const/4 p0, 0x0

    .end local p2           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    :goto_5
    move-object p2, v3

    .line 75
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    goto :goto_3

    .line 74
    .local v0, fos:Ljava/io/FileOutputStream;
    .restart local v1       #title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    :catch_1
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object p0, v0

    .end local v0           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    move-object v0, v1

    .line 76
    .end local v1           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    goto :goto_3

    .line 74
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p2, fos:Ljava/io/FileOutputStream;
    :catch_2
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object p0, p2

    .end local p2           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    move-object p2, v3

    .line 76
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    goto :goto_3

    .line 69
    .end local v0           #title:Ljava/lang/String;
    .local v1, fileText:Ljava/io/File;
    .restart local v2       #fos:Ljava/io/FileOutputStream;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :catchall_0
    move-exception p0

    move-object p1, p0

    move-object p0, v2

    .line 70
    .end local v1           #fileText:Ljava/io/File;
    .end local v2           #fos:Ljava/io/FileOutputStream;
    .end local p1           #db:Lcom/xiaomi/notes/DBOperate;
    .end local p2           #isEnd:Z
    .local p0, fos:Ljava/io/FileOutputStream;
    :goto_6
    if-eqz p0, :cond_4

    .line 71
    :try_start_6
    invoke-virtual {p0}, Ljava/io/FileOutputStream;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_3

    .line 72
    const/4 p0, 0x0

    .line 75
    :cond_4
    :goto_7
    throw p1

    .line 74
    :catch_3
    move-exception p2

    goto :goto_7

    .line 69
    .local v0, fos:Ljava/io/FileOutputStream;
    .local p0, context:Landroid/content/Context;
    :catchall_1
    move-exception p0

    move-object p1, p0

    move-object p0, v0

    .end local v0           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    goto :goto_6

    .local p0, context:Landroid/content/Context;
    .local p2, fos:Ljava/io/FileOutputStream;
    :catchall_2
    move-exception p0

    move-object p1, p0

    move-object p0, p2

    .end local p2           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    goto :goto_6

    .line 64
    .restart local v1       #fileText:Ljava/io/File;
    .restart local v2       #fos:Ljava/io/FileOutputStream;
    .local p0, context:Landroid/content/Context;
    .restart local p1       #db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :catch_4
    move-exception p1

    move-object p2, v2

    .end local v2           #fos:Ljava/io/FileOutputStream;
    .local p2, fos:Ljava/io/FileOutputStream;
    goto :goto_4

    .end local v1           #fileText:Ljava/io/File;
    .local v0, title:Ljava/lang/String;
    .local p1, message:Ljava/lang/String;
    :cond_5
    move-object p0, p2

    .end local p2           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    goto :goto_5

    .end local v3           #ret:Ljava/lang/String;
    .local v0, fos:Ljava/io/FileOutputStream;
    .local v1, title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p2, ret:Ljava/lang/String;
    :cond_6
    move-object p0, v0

    .end local v0           #fos:Ljava/io/FileOutputStream;
    .local p0, fos:Ljava/io/FileOutputStream;
    goto :goto_2
.end method

.method public static callExportTxt(Landroid/content/Context;Lcom/xiaomi/notes/DBOperate;Z)Ljava/lang/String;
    .locals 8
    .parameter "context"
    .parameter "db"
    .parameter "isEnd"

    .prologue
    .line 337
    const/4 v3, 0x0

    .line 340
    .local v3, ret:Ljava/lang/String;
    const-string v0, "mounted"

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 341
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1
    const p2, 0x7f050038

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    .end local p2
    move-result-object p2

    .line 342
    .local p2, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v0, 0x7f05002c

    invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object p1

    .line 343
    .local p1, message:Ljava/lang/String;
    invoke-static {p0, p2, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    move-object p0, p1

    .end local p1           #message:Ljava/lang/String;
    .local p0, message:Ljava/lang/String;
    move-object v0, p2

    .end local p2           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    move-object p1, v3

    .end local v3           #ret:Ljava/lang/String;
    .local p1, ret:Ljava/lang/String;
    move-object p2, v3

    .line 384
    .end local p1           #ret:Ljava/lang/String;
    :goto_0
    return-object p2

    .line 347
    .end local v0           #title:Ljava/lang/String;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :cond_0
    const-string v0, "notes_%s.txt"

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    invoke-static {p0, v4, v5}, Lcom/xiaomi/notes/Tools;->getDateYMD(Landroid/content/Context;J)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .line 349
    .local v4, strFileName:Ljava/lang/String;
    const/4 v2, 0x0

    .line 350
    .local v2, fosText:Ljava/io/FileOutputStream;
    new-instance v0, Ljava/io/File;

    sget-object v1, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 351
    .local v0, dic:Ljava/io/File;
    new-instance v1, Ljava/io/File;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v6, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v1, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 353
    .local v1, fileText:Ljava/io/File;
    :try_start_0
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v5

    if-nez v5, :cond_1

    .line 354
    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    .line 356
    :cond_1
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v0

    .end local v0           #dic:Ljava/io/File;
    if-nez v0, :cond_2

    .line 357
    invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z

    .line 360
    :cond_2
    new-instance v0, Ljava/io/FileOutputStream;

    invoke-direct {v0, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4

    .line 361
    .end local v2           #fosText:Ljava/io/FileOutputStream;
    .local v0, fosText:Ljava/io/FileOutputStream;
    :try_start_1
    invoke-static {p0, p1, v0}, Lcom/xiaomi/notes/ShareData;->backupTxt(Landroid/content/Context;Lcom/xiaomi/notes/DBOperate;Ljava/io/FileOutputStream;)V

    .line 362
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #db:Lcom/xiaomi/notes/DBOperate;
    const v1, 0x7f050036

    invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    .end local v1           #fileText:Ljava/io/File;
    move-result-object v1

    .line 363
    .local v1, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v2, 0x7f050033

    const/4 v5, 0x2

    new-array v5, v5, [Ljava/lang/Object;

    const/4 v6, 0x0

    aput-object v4, v5, v6

    const/4 v6, 0x1

    const-string v7, "xm_notes"

    aput-object v7, v5, v6

    invoke-virtual {p1, v2, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    .line 365
    .local p1, message:Ljava/lang/String;
    if-eqz p2, :cond_3

    .line 366
    invoke-static {p0, v1, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 370
    .end local p2           #isEnd:Z
    :goto_1
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v2, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p2

    invoke-virtual {p2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p2

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result-object p2

    .line 377
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    if-eqz v0, :cond_6

    .line 378
    :try_start_2
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 379
    const/4 p0, 0x0

    .end local v0           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    :goto_2
    move-object v0, v1

    .end local v1           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    :goto_3
    move-object p0, p1

    .end local p1           #message:Ljava/lang/String;
    .local p0, message:Ljava/lang/String;
    move-object p1, p2

    .line 384
    .end local p2           #ret:Ljava/lang/String;
    .local p1, ret:Ljava/lang/String;
    goto/16 :goto_0

    .line 368
    .local v0, fosText:Ljava/io/FileOutputStream;
    .restart local v1       #title:Ljava/lang/String;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, message:Ljava/lang/String;
    .local p2, isEnd:Z
    :cond_3
    const/4 p2, 0x1

    :try_start_3
    invoke-static {p0, p1, p2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    .end local p2           #isEnd:Z
    move-result-object p2

    invoke-virtual {p2}, Landroid/widget/Toast;->show()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0

    goto :goto_1

    .line 371
    .end local v1           #title:Ljava/lang/String;
    .end local p1           #message:Ljava/lang/String;
    :catch_0
    move-exception p1

    move-object p2, v0

    .line 372
    .end local v0           #fosText:Ljava/io/FileOutputStream;
    .local p1, e:Ljava/lang/Exception;
    .local p2, fosText:Ljava/io/FileOutputStream;
    :goto_4
    :try_start_4
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #e:Ljava/lang/Exception;
    const v0, 0x7f050037

    invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 373
    .local v0, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v1, 0x7f050030

    invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object p1

    .line 374
    .local p1, message:Ljava/lang/String;
    invoke-static {p0, v0, p1}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_2

    .line 377
    if-eqz p2, :cond_5

    .line 378
    :try_start_5
    invoke-virtual {p2}, Ljava/io/FileOutputStream;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2

    .line 379
    const/4 p0, 0x0

    .end local p2           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    :goto_5
    move-object p2, v3

    .line 382
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    goto :goto_3

    .line 381
    .local v0, fosText:Ljava/io/FileOutputStream;
    .restart local v1       #title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    :catch_1
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object p0, v0

    .end local v0           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    move-object v0, v1

    .line 383
    .end local v1           #title:Ljava/lang/String;
    .local v0, title:Ljava/lang/String;
    goto :goto_3

    .line 381
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p2, fosText:Ljava/io/FileOutputStream;
    :catch_2
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object p0, p2

    .end local p2           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    move-object p2, v3

    .line 383
    .end local v3           #ret:Ljava/lang/String;
    .local p2, ret:Ljava/lang/String;
    goto :goto_3

    .line 376
    .end local v0           #title:Ljava/lang/String;
    .local v1, fileText:Ljava/io/File;
    .restart local v2       #fosText:Ljava/io/FileOutputStream;
    .restart local v3       #ret:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :catchall_0
    move-exception p0

    move-object p1, p0

    move-object p0, v2

    .line 377
    .end local v1           #fileText:Ljava/io/File;
    .end local v2           #fosText:Ljava/io/FileOutputStream;
    .end local p1           #db:Lcom/xiaomi/notes/DBOperate;
    .end local p2           #isEnd:Z
    .local p0, fosText:Ljava/io/FileOutputStream;
    :goto_6
    if-eqz p0, :cond_4

    .line 378
    :try_start_6
    invoke-virtual {p0}, Ljava/io/FileOutputStream;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_3

    .line 379
    const/4 p0, 0x0

    .line 382
    :cond_4
    :goto_7
    throw p1

    .line 381
    :catch_3
    move-exception p2

    goto :goto_7

    .line 376
    .local v0, fosText:Ljava/io/FileOutputStream;
    .local p0, context:Landroid/content/Context;
    :catchall_1
    move-exception p0

    move-object p1, p0

    move-object p0, v0

    .end local v0           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    goto :goto_6

    .local p0, context:Landroid/content/Context;
    .local p2, fosText:Ljava/io/FileOutputStream;
    :catchall_2
    move-exception p0

    move-object p1, p0

    move-object p0, p2

    .end local p2           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    goto :goto_6

    .line 371
    .restart local v1       #fileText:Ljava/io/File;
    .restart local v2       #fosText:Ljava/io/FileOutputStream;
    .local p0, context:Landroid/content/Context;
    .restart local p1       #db:Lcom/xiaomi/notes/DBOperate;
    .local p2, isEnd:Z
    :catch_4
    move-exception p1

    move-object p2, v2

    .end local v2           #fosText:Ljava/io/FileOutputStream;
    .local p2, fosText:Ljava/io/FileOutputStream;
    goto :goto_4

    .end local v1           #fileText:Ljava/io/File;
    .local v0, title:Ljava/lang/String;
    .local p1, message:Ljava/lang/String;
    :cond_5
    move-object p0, p2

    .end local p2           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    goto :goto_5

    .end local v3           #ret:Ljava/lang/String;
    .local v0, fosText:Ljava/io/FileOutputStream;
    .local v1, title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p2, ret:Ljava/lang/String;
    :cond_6
    move-object p0, v0

    .end local v0           #fosText:Ljava/io/FileOutputStream;
    .local p0, fosText:Ljava/io/FileOutputStream;
    goto :goto_2
.end method

.method public static callRestoreXml(Landroid/content/Context;Lcom/xiaomi/notes/DBOperate;)V
    .locals 11
    .parameter "context"
    .parameter "db"

    .prologue
    const v10, 0x7f050037

    const-string v5, "xm_notesnotes.xml"

    .line 196
    const-string v5, "mounted"

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-nez v5, :cond_0

    .line 197
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f050038

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 198
    .local v4, title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f05002c

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 199
    .local v3, message:Ljava/lang/String;
    invoke-static {p0, v4, v3}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 229
    .end local v3           #message:Ljava/lang/String;
    .end local v4           #title:Ljava/lang/String;
    :goto_0
    return-void

    .line 203
    :cond_0
    new-instance v0, Ljava/io/File;

    sget-object v5, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-direct {v0, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 204
    .local v0, dic:Ljava/io/File;
    new-instance v2, Ljava/io/File;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v6, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, "notes.xml"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v2, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 206
    .local v2, fileText:Ljava/io/File;
    :try_start_0
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v5

    if-nez v5, :cond_1

    .line 207
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f050037

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 208
    .restart local v4       #title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f05002d

    const/4 v7, 0x1

    new-array v7, v7, [Ljava/lang/Object;

    const/4 v8, 0x0

    const-string v9, "xm_notesnotes.xml"

    aput-object v9, v7, v8

    invoke-virtual {v5, v6, v7}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    .line 210
    .restart local v3       #message:Ljava/lang/String;
    invoke-static {p0, v4, v3}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 224
    .end local v3           #message:Ljava/lang/String;
    .end local v4           #title:Ljava/lang/String;
    :catch_0
    move-exception v5

    move-object v1, v5

    .line 225
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    invoke-virtual {v5, v10}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 226
    .restart local v4       #title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f05002f

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 227
    .restart local v3       #message:Ljava/lang/String;
    invoke-static {p0, v4, v3}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 213
    .end local v1           #e:Ljava/lang/Exception;
    .end local v3           #message:Ljava/lang/String;
    .end local v4           #title:Ljava/lang/String;
    :cond_1
    :try_start_1
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v5

    if-nez v5, :cond_2

    .line 214
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f050037

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 215
    .restart local v4       #title:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f05002d

    const/4 v7, 0x1

    new-array v7, v7, [Ljava/lang/Object;

    const/4 v8, 0x0

    const-string v9, "xm_notesnotes.xml"

    aput-object v9, v7, v8

    invoke-virtual {v5, v6, v7}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    .line 217
    .restart local v3       #message:Ljava/lang/String;
    invoke-static {p0, v4, v3}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0

    .line 221
    .end local v3           #message:Ljava/lang/String;
    .end local v4           #title:Ljava/lang/String;
    :cond_2
    invoke-static {p0, v2, p1}, Lcom/xiaomi/notes/ShareData;->restoreXml(Landroid/content/Context;Ljava/io/File;Lcom/xiaomi/notes/DBOperate;)V

    .line 222
    const v5, 0x7f050032

    const/4 v6, 0x0

    invoke-static {p0, v5, v6}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v5

    invoke-virtual {v5}, Landroid/widget/Toast;->show()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_0
.end method

.method public static isCanRestore()Z
    .locals 5

    .prologue
    .line 175
    const/4 v2, 0x1

    .line 176
    .local v2, flag:Z
    const-string v3, "mounted"

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_0

    .line 177
    const/4 v2, 0x0

    .line 179
    :cond_0
    new-instance v0, Ljava/io/File;

    sget-object v3, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-direct {v0, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 180
    .local v0, dic:Ljava/io/File;
    new-instance v1, Ljava/io/File;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v4, Lcom/xiaomi/notes/Tools;->STR_SD_DIC_URL:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "notes.xml"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 181
    .local v1, fileText:Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v3

    if-nez v3, :cond_1

    .line 182
    const/4 v2, 0x0

    .line 184
    :cond_1
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v3

    if-nez v3, :cond_2

    .line 185
    const/4 v2, 0x0

    .line 187
    :cond_2
    return v2
.end method

.method private static operateFolder(Lorg/xmlpull/v1/XmlSerializer;Ljava/util/List;)V
    .locals 10
    .parameter "op"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/xmlpull/v1/XmlSerializer;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .local p1, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v6, 0x0

    const-string v9, "foldername"

    const-string v8, "_id"

    const-string v7, "FOLDER"

    .line 104
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v4

    .line 105
    .local v4, nums:I
    const/4 v2, 0x0

    .line 109
    .local v2, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-ge v0, v4, :cond_0

    .line 110
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    .end local v2           #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v2, Ljava/util/Map;

    .line 111
    .restart local v2       #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v5, "_id"

    invoke-interface {v2, v8}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/Integer;

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 112
    .local v1, id:I
    const-string v5, "foldername"

    invoke-interface {v2, v9}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 114
    .local v3, name:Ljava/lang/String;
    const-string v5, "FOLDER"

    invoke-interface {p0, v6, v7}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 116
    const-string v5, "_id"

    invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v5

    invoke-static {p0, v8, v5}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 117
    const-string v5, "foldername"

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-static {p0, v9, v5}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 119
    const-string v5, "FOLDER"

    invoke-interface {p0, v6, v7}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 109
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 121
    .end local v1           #id:I
    .end local v3           #name:Ljava/lang/String;
    :cond_0
    return-void
.end method

.method private static operateNote(Lorg/xmlpull/v1/XmlSerializer;Ljava/util/List;)V
    .locals 19
    .parameter "op"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/xmlpull/v1/XmlSerializer;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 125
    .local p1, list:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v16

    .line 126
    .local v16, nums:I
    const/4 v4, 0x0

    .line 136
    .local v4, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const/4 v3, 0x0

    .local v3, i:I
    move v14, v3

    .end local v3           #i:I
    .local v14, i:I
    move-object v3, v4

    .end local v4           #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v3, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    :goto_0
    move v0, v14

    move/from16 v1, v16

    if-ge v0, v1, :cond_0

    .line 137
    move-object/from16 v0, p1

    move v1, v14

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v15

    check-cast v15, Ljava/util/Map;

    .line 139
    .end local v3           #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v15, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v3, "createTime"

    invoke-interface {v15, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Long;

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v9

    .line 140
    .local v9, create:J
    const-string v3, "fixTime"

    invoke-interface {v15, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Long;

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v11

    .line 141
    .local v11, fix:J
    const-string v3, "alertTime"

    invoke-interface {v15, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Long;

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v3

    .line 142
    .local v3, alert:J
    const-string v5, "bgcolorId"

    invoke-interface {v15, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/Integer;

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    .line 143
    .local v5, bg:I
    const-string v6, "folderId"

    invoke-interface {v15, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/Integer;

    invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I

    move-result v13

    .line 144
    .local v13, folder:I
    const-string v6, "desktopX"

    invoke-interface {v15, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/Integer;

    invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I

    move-result v7

    .line 145
    .local v7, checklist:I
    const-string v6, "checklistInfo"

    invoke-interface {v15, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    .line 146
    .local v6, check:Ljava/lang/String;
    const-string v8, "content"

    invoke-interface {v15, v8}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Ljava/lang/String;

    .line 148
    .local v8, content:Ljava/lang/String;
    const/16 v17, 0x0

    const-string v18, "NOTE"

    move-object/from16 v0, p0

    move-object/from16 v1, v17

    move-object/from16 v2, v18

    invoke-interface {v0, v1, v2}, Lorg/xmlpull/v1/XmlSerializer;->startTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 150
    const-string v17, "createTime"

    invoke-static {v9, v10}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v9

    .end local v9           #create:J
    move-object/from16 v0, p0

    move-object/from16 v1, v17

    move-object v2, v9

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 151
    const-string v9, "fixTime"

    invoke-static {v11, v12}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v10

    move-object/from16 v0, p0

    move-object v1, v9

    move-object v2, v10

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 152
    const-string v9, "alertTime"

    invoke-static {v3, v4}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v3

    .end local v3           #alert:J
    move-object/from16 v0, p0

    move-object v1, v9

    move-object v2, v3

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 153
    const-string v3, "bgcolorId"

    invoke-static {v5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v4

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 154
    const-string v3, "folderId"

    invoke-static {v13}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v4

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 155
    const-string v3, "desktopX"

    invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v4

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 156
    const-string v3, "checklistInfo"

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v6

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 157
    const-string v3, "content"

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v8

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->addKeyValue(Lorg/xmlpull/v1/XmlSerializer;Ljava/lang/String;Ljava/lang/String;)V

    .line 159
    const/4 v3, 0x0

    const-string v4, "NOTE"

    move-object/from16 v0, p0

    move-object v1, v3

    move-object v2, v4

    invoke-interface {v0, v1, v2}, Lorg/xmlpull/v1/XmlSerializer;->endTag(Ljava/lang/String;Ljava/lang/String;)Lorg/xmlpull/v1/XmlSerializer;

    .line 136
    add-int/lit8 v3, v14, 0x1

    .end local v14           #i:I
    .local v3, i:I
    move v14, v3

    .end local v3           #i:I
    .restart local v14       #i:I
    move-object v3, v15

    .end local v15           #info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    .local v3, info:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    goto/16 :goto_0

    .line 161
    .end local v5           #bg:I
    .end local v6           #check:Ljava/lang/String;
    .end local v7           #checklist:I
    .end local v8           #content:Ljava/lang/String;
    .end local v11           #fix:J
    .end local v13           #folder:I
    :cond_0
    return-void
.end method

.method private static restoreXml(Landroid/content/Context;Ljava/io/File;Lcom/xiaomi/notes/DBOperate;)V
    .locals 38
    .parameter "context"
    .parameter "f"
    .parameter "db"

    .prologue
    .line 232
    invoke-static {}, Landroid/util/Xml;->newPullParser()Lorg/xmlpull/v1/XmlPullParser;

    move-result-object v34

    .line 234
    .local v34, parse:Lorg/xmlpull/v1/XmlPullParser;
    const/16 v16, 0x0

    .line 236
    .local v16, fis:Ljava/io/FileInputStream;
    :try_start_0
    new-instance v31, Ljava/io/FileInputStream;

    move-object/from16 v0, v31

    move-object/from16 v1, p1

    invoke-direct {v0, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 237
    .end local v16           #fis:Ljava/io/FileInputStream;
    .local v31, fis:Ljava/io/FileInputStream;
    const/16 p1, 0x0

    :try_start_1
    move-object/from16 v0, v34

    move-object/from16 v1, v31

    move-object/from16 v2, p1

    invoke-interface {v0, v1, v2}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V

    .line 239
    .end local p1
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getEventType()I

    move-result p1

    .line 241
    .local p1, eventCode:I
    const-string v25, ""

    .line 243
    .local v25, key:Ljava/lang/String;
    const/16 v22, 0x0

    .line 244
    .local v22, id:I
    const-string v26, ""

    .line 246
    .local v26, title:Ljava/lang/String;
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v16

    .line 247
    .local v16, create:J
    move-wide/from16 v18, v16

    .line 248
    .local v18, fix:J
    const-wide/16 v20, 0x0

    .line 249
    .local v20, alert:J
    const/16 v23, 0x0

    .line 250
    .local v23, bg:I
    const/16 v24, -0x1

    .line 251
    .local v24, folder:I
    const/16 v27, 0x0

    .line 252
    .local v27, checklist:I
    const-string v29, ""

    .line 253
    .local v29, check:Ljava/lang/String;
    const-string v30, ""

    .local v30, content:Ljava/lang/String;
    move-object/from16 v35, v26

    .end local v26           #title:Ljava/lang/String;
    .local v35, title:Ljava/lang/String;
    move/from16 v32, v22

    .end local v22           #id:I
    .local v32, id:I
    move-object/from16 v33, v25

    .line 255
    .end local v25           #key:Ljava/lang/String;
    .local v33, key:Ljava/lang/String;
    :goto_0
    const/16 v22, 0x1

    move/from16 v0, p1

    move/from16 v1, v22

    if-eq v0, v1, :cond_f

    .line 256
    packed-switch p1, :pswitch_data_0

    .end local p1           #eventCode:I
    :cond_0
    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .line 315
    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    :goto_1
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->next()I

    move-result p1

    .restart local p1       #eventCode:I
    move-object/from16 v35, v26

    .end local v26           #title:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    move/from16 v32, v22

    .end local v22           #id:I
    .restart local v32       #id:I
    move-object/from16 v33, v25

    .end local v25           #key:Ljava/lang/String;
    .restart local v33       #key:Ljava/lang/String;
    goto :goto_0

    .line 258
    :pswitch_0
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object p1

    .end local p1           #eventCode:I
    const-string v22, "FOLDER"

    move-object/from16 v0, p1

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    .line 259
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v16

    .line 260
    move-wide/from16 v18, v16

    .line 261
    const-wide/16 v20, 0x0

    .line 262
    const/16 v23, 0x0

    .line 263
    const/16 v24, -0x1

    .line 264
    const/16 v27, 0x0

    .line 265
    const-string v29, ""

    .line 266
    const-string v30, ""

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto :goto_1

    .line 267
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_1
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object p1

    const-string v22, "NOTE"

    move-object/from16 v0, p1

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_2

    .line 268
    const/16 p1, 0x0

    .line 269
    .end local v32           #id:I
    .local p1, id:I
    const-string v22, ""

    .end local v35           #title:Ljava/lang/String;
    .local v22, title:Ljava/lang/String;
    move-object/from16 v26, v22

    .end local v22           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    move/from16 v22, p1

    .end local p1           #id:I
    .local v22, id:I
    goto :goto_1

    .line 271
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_2
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object p1

    .end local v33           #key:Ljava/lang/String;
    .local p1, key:Ljava/lang/String;
    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, p1

    .line 273
    .end local p1           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto :goto_1

    .line 275
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p1, eventCode:I
    :pswitch_1
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object p1

    .end local p1           #eventCode:I
    const-string v22, "FOLDER"

    move-object/from16 v0, p1

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_3

    .line 276
    if-lez v32, :cond_0

    invoke-static/range {v35 .. v35}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_0

    .line 277
    move-object/from16 v0, p2

    move/from16 v1, v32

    move-object/from16 v2, v35

    invoke-virtual {v0, v1, v2}, Lcom/xiaomi/notes/DBOperate;->insertFolder(ILjava/lang/String;)J

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 279
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_3
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;

    move-result-object p1

    const-string v22, "NOTE"

    move-object/from16 v0, p1

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 280
    const/16 v22, 0x0

    const/16 v25, 0x0

    const/16 v26, 0x0

    const/16 v28, 0x0

    move-object/from16 v0, p2

    move-wide/from16 v1, v16

    move-wide/from16 v3, v18

    move-wide/from16 v5, v20

    move/from16 v7, v22

    move/from16 v8, v23

    move/from16 v9, v24

    move/from16 v10, v25

    move/from16 v11, v26

    move/from16 v12, v27

    move/from16 v13, v28

    move-object/from16 v14, v29

    move-object/from16 v15, v30

    invoke-virtual/range {v0 .. v15}, Lcom/xiaomi/notes/DBOperate;->insertNote(JJJIIIIIIILjava/lang/String;Ljava/lang/String;)J

    move-result-wide v25

    .line 282
    .local v25, nid:J
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v36

    cmp-long p1, v20, v36

    if-lez p1, :cond_4

    .line 283
    move-wide/from16 v0, v25

    long-to-int v0, v0

    move/from16 p1, v0

    move-object/from16 v0, p0

    move/from16 v1, p1

    move-object/from16 v2, v30

    move-wide/from16 v3, v20

    invoke-static {v0, v1, v2, v3, v4}, Lcom/xiaomi/notes/Tools;->setAlertTime(Landroid/content/Context;ILjava/lang/String;J)V

    :cond_4
    move-object/from16 v26, v35

    .end local v25           #nid:J
    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .line 285
    .end local v33           #key:Ljava/lang/String;
    .local v25, key:Ljava/lang/String;
    goto/16 :goto_1

    .line 288
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .restart local p1       #eventCode:I
    :pswitch_2
    if-nez v33, :cond_5

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .line 289
    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 291
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_5
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getText()Ljava/lang/String;

    move-result-object p1

    .line 292
    .local p1, value:Ljava/lang/String;
    const-string v22, "_id"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_6

    .line 293
    invoke-static/range {p1 .. p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result p1

    .end local v32           #id:I
    .local p1, id:I
    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, p1

    .end local p1           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 294
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p1, value:Ljava/lang/String;
    :cond_6
    const-string v22, "foldername"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_7

    .line 295
    invoke-interface/range {v34 .. v34}, Lorg/xmlpull/v1/XmlPullParser;->getText()Ljava/lang/String;

    move-result-object p1

    .end local v35           #title:Ljava/lang/String;
    .local p1, title:Ljava/lang/String;
    move-object/from16 v26, p1

    .end local p1           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 296
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p1, value:Ljava/lang/String;
    :cond_7
    const-string v22, "createTime"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_8

    .line 297
    invoke-static/range {p1 .. p1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v16

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 298
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_8
    const-string v22, "fixTime"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_9

    .line 299
    invoke-static/range {p1 .. p1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v18

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 300
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_9
    const-string v22, "alertTime"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_a

    .line 301
    invoke-static/range {p1 .. p1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v20

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 302
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_a
    const-string v22, "bgcolorId"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_b

    .line 303
    invoke-static/range {p1 .. p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v23

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 304
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_b
    const-string v22, "folderId"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_c

    .line 305
    invoke-static/range {p1 .. p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v24

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 306
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_c
    const-string v22, "desktopX"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_d

    .line 307
    invoke-static/range {p1 .. p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v27

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 308
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_d
    const-string v22, "checklistInfo"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v22

    if-eqz v22, :cond_e

    .line 309
    move-object/from16 v29, p1

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 310
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    :cond_e
    const-string v22, "content"

    move-object/from16 v0, v33

    move-object/from16 v1, v22

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4

    move-result v22

    if-eqz v22, :cond_0

    .line 311
    move-object/from16 v30, p1

    move-object/from16 v26, v35

    .end local v35           #title:Ljava/lang/String;
    .restart local v26       #title:Ljava/lang/String;
    move/from16 v22, v32

    .end local v32           #id:I
    .restart local v22       #id:I
    move-object/from16 v25, v33

    .end local v33           #key:Ljava/lang/String;
    .restart local v25       #key:Ljava/lang/String;
    goto/16 :goto_1

    .line 323
    .end local v22           #id:I
    .end local v25           #key:Ljava/lang/String;
    .end local v26           #title:Ljava/lang/String;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p1, eventCode:I
    :cond_f
    if-eqz v31, :cond_12

    .line 325
    :try_start_2
    invoke-virtual/range {v31 .. v31}, Ljava/io/FileInputStream;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    .line 326
    const/16 p0, 0x0

    .line 331
    .end local v16           #create:J
    .end local v18           #fix:J
    .end local v20           #alert:J
    .end local v23           #bg:I
    .end local v24           #folder:I
    .end local v27           #checklist:I
    .end local v29           #check:Ljava/lang/String;
    .end local v30           #content:Ljava/lang/String;
    .end local v31           #fis:Ljava/io/FileInputStream;
    .end local v32           #id:I
    .end local v33           #key:Ljava/lang/String;
    .end local v35           #title:Ljava/lang/String;
    .end local p1           #eventCode:I
    .end local p2
    .local p0, fis:Ljava/io/FileInputStream;
    :goto_2
    return-void

    .line 327
    .restart local v16       #create:J
    .restart local v18       #fix:J
    .restart local v20       #alert:J
    .restart local v23       #bg:I
    .restart local v24       #folder:I
    .restart local v27       #checklist:I
    .restart local v29       #check:Ljava/lang/String;
    .restart local v30       #content:Ljava/lang/String;
    .restart local v31       #fis:Ljava/io/FileInputStream;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .restart local p1       #eventCode:I
    .restart local p2
    :catch_0
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object/from16 p0, v31

    .line 328
    .end local v31           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_2

    .line 317
    .end local v18           #fix:J
    .end local v20           #alert:J
    .end local v23           #bg:I
    .end local v24           #folder:I
    .end local v27           #checklist:I
    .end local v29           #check:Ljava/lang/String;
    .end local v30           #content:Ljava/lang/String;
    .end local v32           #id:I
    .end local v33           #key:Ljava/lang/String;
    .end local v35           #title:Ljava/lang/String;
    .local v16, fis:Ljava/io/FileInputStream;
    .local p0, context:Landroid/content/Context;
    .local p1, f:Ljava/io/File;
    :catch_1
    move-exception p1

    move-object/from16 p2, v16

    .line 318
    .end local v16           #fis:Ljava/io/FileInputStream;
    .local p1, e:Ljava/lang/Exception;
    .local p2, fis:Ljava/io/FileInputStream;
    :goto_3
    :try_start_3
    invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .end local p1           #e:Ljava/lang/Exception;
    const v16, 0x7f050037

    move-object/from16 v0, p1

    move/from16 v1, v16

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v16

    .line 319
    .local v16, title:Ljava/lang/String;
    invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v17, 0x7f05002f

    move-object/from16 v0, p1

    move/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object p1

    .line 321
    .local p1, message:Ljava/lang/String;
    move-object/from16 v0, p0

    move-object/from16 v1, v16

    move-object/from16 v2, p1

    invoke-static {v0, v1, v2}, Lcom/xiaomi/notes/ShareData;->showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    .line 323
    if-eqz p2, :cond_11

    .line 325
    :try_start_4
    invoke-virtual/range {p2 .. p2}, Ljava/io/FileInputStream;->close()V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2

    .line 326
    const/16 p0, 0x0

    .end local p2           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_2

    .line 327
    .local p0, context:Landroid/content/Context;
    .restart local p2       #fis:Ljava/io/FileInputStream;
    :catch_2
    move-exception p0

    .end local p0           #context:Landroid/content/Context;
    move-object/from16 p0, p2

    .line 328
    .end local p2           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_2

    .line 323
    .local v16, fis:Ljava/io/FileInputStream;
    .local p0, context:Landroid/content/Context;
    .local p1, f:Ljava/io/File;
    .local p2, db:Lcom/xiaomi/notes/DBOperate;
    :catchall_0
    move-exception p0

    move-object/from16 p1, p0

    move-object/from16 p0, v16

    .end local v16           #fis:Ljava/io/FileInputStream;
    .end local p1           #f:Ljava/io/File;
    .end local p2           #db:Lcom/xiaomi/notes/DBOperate;
    .local p0, fis:Ljava/io/FileInputStream;
    :goto_4
    if-eqz p0, :cond_10

    .line 325
    :try_start_5
    invoke-virtual/range {p0 .. p0}, Ljava/io/FileInputStream;->close()V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_3

    .line 326
    const/16 p0, 0x0

    .line 328
    :cond_10
    :goto_5
    throw p1

    .line 327
    :catch_3
    move-exception p2

    goto :goto_5

    .line 323
    .restart local v31       #fis:Ljava/io/FileInputStream;
    .local p0, context:Landroid/content/Context;
    .restart local p2       #db:Lcom/xiaomi/notes/DBOperate;
    :catchall_1
    move-exception p0

    move-object/from16 p1, p0

    move-object/from16 p0, v31

    .end local v31           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_4

    .local p0, context:Landroid/content/Context;
    .local p2, fis:Ljava/io/FileInputStream;
    :catchall_2
    move-exception p0

    move-object/from16 p1, p0

    move-object/from16 p0, p2

    .end local p2           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_4

    .line 317
    .restart local v31       #fis:Ljava/io/FileInputStream;
    .local p0, context:Landroid/content/Context;
    .local p2, db:Lcom/xiaomi/notes/DBOperate;
    :catch_4
    move-exception p1

    move-object/from16 p2, v31

    .end local v31           #fis:Ljava/io/FileInputStream;
    .local p2, fis:Ljava/io/FileInputStream;
    goto :goto_3

    .local v16, title:Ljava/lang/String;
    .local p1, message:Ljava/lang/String;
    :cond_11
    move-object/from16 p0, p2

    .end local p2           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_2

    .local v16, create:J
    .restart local v18       #fix:J
    .restart local v20       #alert:J
    .restart local v23       #bg:I
    .restart local v24       #folder:I
    .restart local v27       #checklist:I
    .restart local v29       #check:Ljava/lang/String;
    .restart local v30       #content:Ljava/lang/String;
    .restart local v31       #fis:Ljava/io/FileInputStream;
    .restart local v32       #id:I
    .restart local v33       #key:Ljava/lang/String;
    .restart local v35       #title:Ljava/lang/String;
    .local p0, context:Landroid/content/Context;
    .local p1, eventCode:I
    .local p2, db:Lcom/xiaomi/notes/DBOperate;
    :cond_12
    move-object/from16 p0, v31

    .end local v31           #fis:Ljava/io/FileInputStream;
    .local p0, fis:Ljava/io/FileInputStream;
    goto :goto_2

    .line 256
    nop

    :pswitch_data_0
    .packed-switch 0x2
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method private static showConfirm(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3
    .parameter "context"
    .parameter "title"
    .parameter "message"

    .prologue
    .line 482
    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 483
    .local v0, exit:Landroid/app/AlertDialog$Builder;
    invoke-virtual {v0, p1}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 484
    invoke-virtual {v0, p2}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 485
    const v1, 0x7f050039

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 486
    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    .line 487
    return-void
.end method

.method private static writeString(Ljava/io/FileOutputStream;Ljava/lang/String;Z)V
    .locals 2
    .parameter "fosContent"
    .parameter "string"
    .parameter "line"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 470
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 471
    const-string v1, "UTF-8"

    invoke-virtual {p1, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    .line 472
    .local v0, byt:[B
    invoke-virtual {p0, v0}, Ljava/io/FileOutputStream;->write([B)V

    .line 474
    .end local v0           #byt:[B
    :cond_0
    if-eqz p2, :cond_1

    .line 475
    const/4 v1, 0x2

    new-array v1, v1, [B

    fill-array-data v1, :array_0

    invoke-virtual {p0, v1}, Ljava/io/FileOutputStream;->write([B)V

    .line 479
    :cond_1
    return-void

    .line 475
    nop

    :array_0
    .array-data 0x1
        0xdt
        0xat
    .end array-data
.end method
